package edu.jd.software.web.backend.controller;

import edu.jd.software.web.backend.common.api.CommonPage;
import edu.jd.software.web.backend.common.api.CommonResult;
import edu.jd.software.web.backend.mbg.model.PmsBrand;
import edu.jd.software.web.backend.service.PmsBrandService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
@Tag(name = "PmsBrandController", description = "商品品牌管理")
@RequestMapping("/brand")
public class PmsBrandController {
    @Autowired
    private PmsBrandService brandService;

    @Operation(summary = "获取指定id的品牌详情")
    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    @ResponseBody
    public CommonResult<PmsBrand> brand(@PathVariable("id") @Parameter(description = "品牌id")Long id) {
        return CommonResult.success(brandService.getBrand(id));
    }


}
